package com.dahua.messagesyncsh.rabbitmq.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class H485 {
    private String equipmentId;

    private String dataTime;

    private String manufacturer;

    private List<Integer[]> data;

    public String toString() {

        StringBuilder sb = new StringBuilder();

        for (Integer[] integers : data) {
            sb.append("[").append(integers[0]).append(",").append(integers[1]).append("],");
        }

        return "T485{" +
                " \"equipmentId\":" + "\"" + equipmentId + '\"' +
                ", \"dataTime\":" + dataTime +
                ", \"manufacturer\":'" + "\"" + manufacturer + '\"' +
                ", \"data\":" + sb +
                '}';
    }
}
